import cookie from 'vue-cookies'
export default {
  state: {
    token: ''
  },
  mutations: {
    // 存放token
    setToken (state, val) {
      state.token = val
      cookie.set('token', val)
    },
    // 清空token
    clearToken (state) {
      state.token = ''
      cookie.remove('token')
    },
    // 获取token
    getToken (state) {
      state.token = cookie.get('token')
    }
  },
  actions: {}
}
